/**
 * @summar 用户模块
 * @author  ll
 */

import * as userAPI from '@/api/user';

export default {
  namespaced: true,
  state: {
    userList: {},
    userInfoList: {},
  },
  mutations: {
    SET_USER_LIST(state, newValue) {
      state.userList = newValue;
    },
    SET_USER_INFO_LIST(state, newValue) {
      state.userInfoList = newValue;
    },
  },
  actions: {
    async updateUserList(context) {
      const res = await userAPI.getUserList();
      context.commit('SET_USER_LIST', res);
    },
    async updateUserInfoList(context) {
      const res = await userAPI.getUserInfoList();
      context.commit('SET_USER_INFO_LIST', res);
    },

  }
}
